package com.cn.example;

import com.cn.common.ClientType;
import com.cn.example.rpc.IDemoService;
import com.cn.remote.RemoteClient;
import com.cn.rpc.RpcProxy;

import java.math.BigDecimal;

public class TestRpcClient {


    public static void main(String[] args) {

        RemoteClient remoteClient = new RemoteClient("127.0.0.1:20200", new ClientType(2));
        try {
            remoteClient.start();
            IDemoService demoService = RpcProxy.getProxy(IDemoService.class, remoteClient);
            Object result = demoService.sayHello("姚进", 21, 134.01, new BigDecimal("123.09344"));
            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
            remoteClient.stop();
        }

    }

}
